<include file="public/layout" />
<script src="__ROOT__/public/static/js/layer/laydate/laydate.js"></script>
<body style="background-color: #FFF; overflow: auto;">
<div class="page">
  <div class="fixed-bar">
    <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
      <div class="subject">
        <h3> 广告详情</h3>
        <h5>广告添加与管理</h5>
      </div>
    </div>
  </div>
  <!--表单数据-->
  <form method="post" id="handleposition" action="{:U('Admin/Ad/adHandle')}">
    <div class="ncap-form-default">
      <dl class="row">
        <dt class="tit">
          <label><em>*</em>广告名称：</label>
        </dt>
        <dd class="opt">
          <input type="text" placeholder="名称" class="input-txt" name="ad_name" value="{$info.ad_name|default='自定义广告名称'}">
          <span class="err" id="err_ad_name" style="color:#F00; display:none;">广告名称不能为空</span>
          <p class="notic"></p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit" colspan="2">
          <label>广告类型：</label>
        </dt>
        <dd class="opt">
          <div id="gcategory">
            <select name="media_type" class="input-sm" class="form-control">
              <option value="0">图片</option>
              <option value="1">flash</option>
            </select>
          </div>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit" colspan="2">
          <label>广告位置：</label>
        </dt>
        <dd class="opt">
          <div>
            <select name="pid" class="input-sm" class="form-control">
              <volist name="position" id="item">
                <option value="{$item.position_id}" <if condition="$info[pid] eq $item[position_id]">selected</if>>{$item.position_name}</option>
              </volist>
            </select>
          </div>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label>开始日期：</label>
        </dt>
        <dd class="opt">
          <input type="text" class="input-txt" id="start_time" name="begin"  value="{$info.start_time|default='2016-01-01'}"/>
          <span class="err"></span>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label>结束时间：</label>
        </dt>
        <dd class="opt">
          <input type="text" class="input-txt" id="end_time" name="end"  value="{$info.end_time|default='2019-01-01'}"/>
          <span class="err"></span>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label><em>*</em>广告链接：</label>
        </dt>
        <dd class="opt">
          <input type="text" placeholder="广告链接" class="input-txt" name="ad_link" value="{$info.ad_link}">
          <span class="err" id="err_ad_link" style="color:#F00; display:none;"></span>
          <p class="notic"></p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label>广告图片</label>
        </dt>
        <dd class="opt">
          <div class="input-file-show">
                        <span class="show">
                            <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="{$info.ad_code}">
                              <i id="img_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src={$info.ad_code}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
                            </a>
                        </span>
           	            <span class="type-file-box">
                            <input type="text" id="ad_code" name="ad_code" value="{$info.ad_code}" class="type-file-text">
                            <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
                            <input class="type-file-file" onClick="GetUploadify(1,'','ad','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                        </span>
          </div>
          <span class="err"></span>
          <p class="notic">请上传图片格式文件</p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label><em>*</em>背景颜色：</label>
        </dt>
        <dd class="opt">
          <input type="color" placeholder="背景颜色：" class="input-txt" name="bgcolor" value="{$info.bgcolor}"  />
          <span class="err" id="err_bgcolor" style="color:#F00; display:none;"></span>
          <p class="notic"></p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label>默认排序：</label>
        </dt>
        <dd class="opt">
          <input type="text" placeholder="排序" name="orderby" value="{$info.orderby}" class="input-txt">
          <span class="err"></span>
          <p class="notic"></p>
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" onclick="adsubmit()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
    </div>
    <input type="hidden" name="act" value="{$act}">
    <input type="hidden" name="ad_id" value="{$info.ad_id}">
  </form>
</div>
<script>
  function adsubmit(){
    $('#handleposition').submit();
  }

  $(document).ready(function(){
    $('#start_time').layDate();
    $('#end_time').layDate();
  });
  function img_call_back(fileurl_tmp)
  {
    $("#ad_code").val(fileurl_tmp);
    $("#img_a").attr('href', fileurl_tmp);
    $("#img_i").attr('onmouseover', "layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
  }
</script>
</body>
</html>